﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class ImageTools : MonoBehaviour
{
    public static bool IsPositionInTheImageArea(Vector3 pos, Image img)
    {
        Vector2 localPos;
        RectTransform rt = img.GetComponent<RectTransform>();
        RectTransformUtility.ScreenPointToLocalPointInRectangle(rt, pos, null, out localPos);
        return rt.rect.Contains(localPos);
    }
}
